﻿@model PagedList.IPagedList<TGBTech.Core.Models.DanhMuc.TaiKhoan>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
@{
    ViewBag.Title = "Tài khoản";
}

<h3>Danh sách Tài khoản</h3>
@using (Html.BeginForm("Index", "TaiKhoan", FormMethod.Post, new { @class = "form-inline", role = "form" }))
{
    <p>
        @Html.TextBox("SearchString", null, new { @class = "form-control", placeholder = "Tìm kiếm", style = "margin-bottom:0px" })
        <input type="submit" value="Tìm kiếm" class="btn btn-default" />
        @Html.ActionLink("Thêm mới", "Create", null, new { @class = "btn btn-primary" })
    </p>
}

<table class="table">
    <tr>
        <th>Mã tài khoản</th>
        <th>Tên tài khoản</th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.MaTaiKhoan)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.ActionLink("Sửa", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Xóa", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>

Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount

@Html.PagedListPager(Model, page => Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))


